﻿@model RonYee.Models.MvcPage

@{
    ViewBag.Title = "用户列表";
    Layout = "~/Views/Shared/_LayoutOfSecondPage.cshtml";
}

<script type="text/javascript">

    function getAjaxPageDate(CurrentPageIndex) {
        var dataStr = "CurrentPageIndex=" + CurrentPageIndex;
        $.ajax({
            type: "POST",
            url: "/Customer/PageIndex",
            data: dataStr,
            contentType: "application/x-www-form-urlencoded;charset=UTF-8",
            async: false, // 同步  true 异步。默认是异步
            error: function (datas) {
                alert(datas);
            },
            success: function (data) {
                $('#content').html(data);
            }
        });
    }
</script>



<div class="box_padding" id="content">
    <h3><i class="ui-icons"></i>检索用户</h3>
    <div class="box_top ui-icons"></div>
    <div class="box_bg">
      <div class="box_padding">
       <div class="border_line">
          @using (Html.BeginForm("Search", "Customer", FormMethod.Post))
            {
                <table width="100%" border="0" id="MyTable" cellpadding="0" cellspacing="0">
                <tbody>
                <tr>
                    <td  class="tdName">用户名</td>
                    <td  class="tdData">
                        <input type="text" id="s_name" name="s_name"/>
                    </td>
                    <td class="tdName">学号</td>
                    <td class="tdData">
                        <input type="text" id="s_no" name="s_no"/>
                    </td>
                </tr>
                <tr>
                    <td  class="tdName">起始时间</td>
                    <td  class="tdData">
                        <input type="text" id="s_time" name="s_time"/>
                    </td>
                    <td class="tdName">结束时间</td>
                    <td class="tdData">
                        <input type="text" id="e_time" name="e_time"/>
                    </td>
                </tr>
                <tr>
                    <td class="tdData"></td>
                    <td class="tdData"></td>
                    <td class="tdData"></td>
                    <td class="tdData">
                        <input type="submit" value="查询》" class="Button1 ui-icons" />
                    </td>
                </tr>  
                </tbody>
                </table>
                    
            }
        
       </div>
      </div>
    </div>
    <div class="box_down ui-icons"></div>
 @using (Html.BeginForm("PageIndex", "Customer", FormMethod.Post))
 { 
    <h3><i class="ui-icons"></i>用户列表</h3>
    <div class="box_top ui-icons"></div>
    <div class="box_bg"><div class="box_padding">
    <div class="border_line">
         <p>
            <a href="@Url.Action("Create")"><input class="Button1 ui-icons" type="button" value="添加成员" name="Create" /></a>
        </p>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
           <tbody>
            <tr>
                <th class="tdName">
                    用户名
                </th>
                <th class="tdName">
                    学 号
                </th>
                <th class="tdName">
                    手机
                </th>
                <th class="tdName">
                    邮箱
                </th>
                <th class="tdName">
                    用户状态
                </th>
                <th class="tdName">
                    用户类型
                </th>
                <th class="tdName">
                    加入时间
                </th>
                <th class="tdName">
                    编辑
                </th>
                <th class="tdName">
                    详细
                </th>
            </tr>

        @foreach (RonYee.Models.Customer item in Model.CustomerList)
        {
            <tr>
                <td class="tdData">
                   <a href="@Url.Action("Details", "Customer", new { id=item.CustomerId})"> @Html.DisplayFor(modelItem => item.Login)</a>
                </td>
                <td class="tdData">
                    @Html.DisplayFor(modelItem => item.CustomerNo)
                </td>
                <td class="tdData">
                    @Html.DisplayFor(modelItem => item.Phone)
                </td>
                <td class="tdData">
                    @Html.DisplayFor(modelItem => item.Email)
                </td>
                <td class="tdData">
                    @Enum.GetName(typeof(RonYee.Models.Enum.UserType), Convert.ToInt32(item.UserType))
                </td >
                <td class="tdData">
                    @Enum.GetName(typeof(RonYee.Models.Enum.UserState), Convert.ToInt32(item.status))
                </td >
                <td class="tdData">
                    @Html.DisplayFor(modelItem => item.AddTime)
                </td>
                <td class="tdData">
                    @Html.ActionLink("编辑", "Edit", new { id = item.CustomerId })
                </td>
                <td class="tdData">
                    @Html.ActionLink("详细", "Details", new { id = item.CustomerId })
                </td>
            </tr>
        }
          </tbody>
        </table>
       <center>@Html.Partial("~/Views/Shared/_PageIndex.cshtml", Model)</center> 
      </div>
     </div>
    </div>
    <div class="box_down ui-icons"></div>
 }
</div>
<div class="line_top"></div>

